package br.ufrj.dcc.tp.utils;

public enum Config {
	DEFAULT_SERVER_HOSTNAME("localhost"),
	DEFAULT_SERVER_PORT(5315),
	IO_READ_INFINITY(0),
	IO_READ_TIMEOUT(50),
	SLEEP_TIMEOUT(200);
	
	private Object value;
	
	public void setValue(Object value) {
		this.value = value;
	}
	
	Config(Object value) {
		this.value = value;
	}
	
	public Integer toInteger() {
		if( value instanceof Integer ) {
			return (Integer) value;
		} else {
			return null;
		}
	}
	
	@Override
	public String toString() {
		if( value instanceof String ) {
			return (String) value;
		}
		return null;
	}
}
